package com.xiaoma.mvi.business

import android.content.Context
import com.xiaoma.mvi.R
import java.util.concurrent.atomic.AtomicBoolean

object Dimens {

    private val isPrepared = AtomicBoolean()

    private lateinit var context: Context

    fun prepare(context: Context) {
        if (isPrepared.getAndSet(true)) return
        this.context = context
    }

    val viewPaddingTop
        get() = context.resources.getDimensionPixelSize(R.dimen.view_padding_top)

    val viewPaddingHorizontal
        get() = context.resources.getDimensionPixelSize(R.dimen.view_padding_horizontal)

    val viewPaddingBottom
        get() = context.resources.getDimensionPixelSize(R.dimen.view_padding_bottom)


    val enumSelectionItemDimen
        get() = context.resources.getDimensionPixelSize(R.dimen.enum_selection_item_dimen)

    val enumSelectionItemDistance
        get() = context.resources.getDimensionPixelSize(R.dimen.enum_selection_item_distance)
}